from django.urls import path, include
from rest_framework.routers import DefaultRouter
from . import views

# 创建路由器
router = DefaultRouter()

# 注册视图集
router.register(r'templates', views.NotificationTemplateViewSet, basename='notificationtemplate')
router.register(r'notifications', views.NotificationViewSet, basename='notification')
router.register(r'preferences', views.NotificationPreferenceViewSet, basename='notificationpreference')
router.register(r'channels', views.NotificationChannelViewSet, basename='notificationchannel')
router.register(r'logs', views.NotificationLogViewSet, basename='notificationlog')

# URL模式
urlpatterns = [
    # API路由
    path('api/', include(router.urls)),
    
    # 自定义路径（如果需要）
    # path('api/send/', views.SendNotificationView.as_view(), name='send-notification'),
]

# 应用名称
app_name = 'notification_service'